package org.hzz.promotions.types.vo;

import com.alibaba.fastjson2.annotation.JSONField;
import io.gitee.pkmer.fastjson2.enums.BaseEnumWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hzz.promotions.types.enums.coupon.DiscountType;

import java.time.LocalDateTime;

/**
 * @author <a href="mailto:1193094618@qq.com">pkmer</a>
 * <br>
 * <a href = "https://gitee.com/developeros/videos-online">Code Repository</a>
 * At 2024/9/2
 * 展示给用户领取的优惠券
 */
@Data
public class ShowCouponVo {

    @Schema(description = "优惠券ID",example = "1")
    private Long id;

    @Schema(description = "优惠券名称",example = "2023年优惠券")
    private String name;
    @Schema(description = "是否限定作用范围，false：不限定，true：限定。默认false",example = "false")
    private Boolean specific = false;

    @Schema(description = "折扣类型，1：满减，2：每满减，3：折扣，4：无门槛",example = "1")
    @JSONField(serializeUsing = BaseEnumWriter.class)
    private DiscountType discountType;

    @Schema(description = "使用门槛，0：表示无门槛，其他值：最低消费金额",example = "0")
    private Integer thresholdAmount;

    @Schema(description = "折扣值，如果是满减则存满减金额，如果是折扣，则存折扣率，8折就是存80",example = "15")
    private Integer discountValue;

    @Schema(description = "最高优惠金额，满减最大，0：表示没有限制，不为0，则表示该券有金额的限制",example = "0")
    private Integer maxDiscountAmount;

    @Schema(description = "优惠券有效期结束时间",example = "2024-08-30 12:00:00")
    private LocalDateTime termEndTime;

    @Schema(description = "优惠券有效期天数，0：表示有效期是指定有效期的",example = "0")
    private Integer termDays;

    @Schema(description = "是否可领取")
    private boolean avaiable;

    @Schema(description = "是否已经领取")
    private boolean recevied;
}
